home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
ownrdclb
/
focus.frm
< prev
next >
Wrap
Text File
|
1998-05-17
|
3KB
|
127 lines
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 7125
ClientLeft = 4785
ClientTop = 2220
ClientWidth = 6585
LinkTopic = "Form1"
ScaleHeight = 7125
ScaleWidth = 6585
Begin VB.ComboBox cboReal
Height = 315
Left = 420
TabIndex = 6
Text = "Combo1"
Top = 360
Width = 2655
End
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 375
Left = 480
TabIndex = 5
Top = 3360
Width = 1395
End
Begin VB.PictureBox cboThis
Height = 375
Index = 0
Left = 420
ScaleHeight = 315
ScaleWidth = 2595
TabIndex = 0
Top = 780
Width = 2655
End
Begin VB.PictureBox cboThis
Height = 375
Index = 1
Left = 420
ScaleHeight = 315
ScaleWidth = 2595
TabIndex = 1
Top = 1260
Width = 2655
End
Begin VB.PictureBox cboThis
Height = 375
Index = 2
Left = 420
ScaleHeight = 315
ScaleWidth = 2595
TabIndex = 2
Top = 1740
Width = 2655
End
Begin VB.PictureBox cboThis
Height = 375
Index = 3
Left = 420
ScaleHeight = 315
ScaleWidth = 2595
TabIndex = 3
Top = 2220
Width = 2655
End
Begin VB.PictureBox cboThis
Height = 375
Index = 4
Left = 420
ScaleHeight = 315
ScaleWidth = 2595
TabIndex = 4
Top = 2700
Width = 2655
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cboReal_KeyPress(KeyAscii As Integer)
If (KeyAscii >= Asc("a") And KeyAscii <= Asc("b")) Then
KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
End If
End Sub
Private Sub cboThis_KeyPress(Index As Integer, KeyAscii As Integer)
If (KeyAscii >= Asc("a") And KeyAscii <= Asc("b")) Then
KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
End If
End Sub
Private Sub Command1_Click()
Dim i As Long
Dim lW As Long
If (cboThis(0).Width = 2655) Then
lW = Me.ScaleWidth - cboThis(i).Left * 2
Else
lW = 2655
End If
For i = 0 To cboThis.UBound
cboThis(i).Width = lW
Next i
End Sub
Private Sub Form_Load()
Dim i As Integer, l As Long
For i = 0 To cboThis.UBound
AddItems cboThis(i)
Next i
For l = 1 To 100
cboReal.AddItem "Item:" & l
Next l
End Sub
Private Sub AddItems(cboThis As OwnerDrawComboList)
Dim l As Long
For l = 1 To 100
cboThis.AddItemAndData "Item:" & l & " & for testing ampersand", , (l Mod 3) * 8
Next l
cboThis.ListIndex = 0
End Sub